# @FileName  :  course.py
# @Time      :  2025/8/19
# @Author    :  靳一涛
# @info      :  课程相关的Pydantic模型
"""
    所有响应模型以Response结尾
    所有添加模型以Create结尾
    所有更新模型以Update结尾
"""
"""
    extral_1: 课程独有的id认证
    extral_2: 老师代课课程独有的id认证
    status：
    0 代表未有老师代课的课程
    1 ***
    2 ***
    3 代表已有老师代课的课程
"""
from pydantic import BaseModel
from typing import Optional,List

# 管理员端











# 教师端

# 获取所有课程的响应模型
class TeacherCourseResponse(BaseModel):
    """
    获取教室课程
    """
    id: int
    name: Optional[str] = None
    picture: Optional[str] = None
    status: Optional[str] = None
    user_id_id: int
    video: Optional[str] = None
    content: Optional[str] = None
    extral_1: Optional[str] = None
    extral_2: Optional[str] = None
    extral_3: Optional[str] = None

    class Config:
        from_attributes = True

# 添加自己的课程
class TeacherCourseCreate(BaseModel):
    """
    添加教室课程
    """
    name: Optional[str] = None
    picture: Optional[str] = None
    status: Optional[str] = None
    user_id_id: int
    video: Optional[str] = None
    content: Optional[str] = None
    extral_1: Optional[str] = None
    extral_2: Optional[str] = None
    extral_3: Optional[str] = None
    class Config:
        from_attributes = True

# 获取自己待处理的课程
class UserResponse(BaseModel):
    id: int
    name: Optional[str] = None

    class Config:
        from_attributes = True
class TeacherCourseWaitResponse(BaseModel):
    """
    获取教师待处理的课程
    """
    id: int
    name: Optional[str] = None
    picture: Optional[str] = None
    status: Optional[str] = None
    video: Optional[str] = None
    content: Optional[str] = None
    extral_1: Optional[str] = None
    extral_2: Optional[str] = None
    extral_3: Optional[str] = None
    user_id_tea: int
    user_id_stu: UserResponse






# 学生端

# 获取所有课程的响应模型


class StudentCourseResponse(BaseModel):
    id: int
    name: Optional[str] = None
    picture: Optional[str] = None
    status: Optional[str] = None
    user_id: UserResponse
    video: Optional[str] = None
    content: Optional[str] = None
    extral_1: Optional[str] = None
    extral_2: Optional[str] = None
    extral_3: Optional[str] = None

    class Config:
        from_attributes = True

# 选择自己的学习课程
class StudentCourseCreate(BaseModel):
    """
    选择学生课程
    """
    name: Optional[str] = None
    picture: Optional[str] = None
    status: Optional[str] = None
    user_id_id: int
    video: Optional[str] = None
    content: Optional[str] = None
    extral_1: Optional[str] = None
    extral_2: Optional[str] = None
    extral_3: Optional[str] = None

    class Config:
        from_attributes = True

class Student_CourseCreate(BaseModel):
    """
    选择学生课程
    """
    name: Optional[str] = None
    picture: Optional[str] = None
    status: Optional[str] = None
    user_id_tea: int
    user_id_stu_id: int
    video: Optional[str] = None
    content: Optional[str] = None
    extral_1: Optional[str] = None
    extral_2: Optional[str] = None
    extral_3: Optional[str] = None

    class Config:
        from_attributes = True
# 学生查看自己的课程
class LoginResponse(BaseModel):
    id: int
    role: Optional[str] = None
    class Config:
        from_attributes = True
class UserResponse1(BaseModel):
    id: int
    name: Optional[str] = None
    login_id: LoginResponse
    class Config:
        from_attributes = True
class Student_myCourseResponse(BaseModel):
    id: int
    name: Optional[str] = None
    picture: Optional[str] = None
    status: Optional[str] = None
    user_id: UserResponse1
    video: Optional[str] = None
    content: Optional[str] = None
    extral_1: Optional[str] = None
    extral_2: Optional[str] = None
    extral_3: Optional[str] = None

    class Config:
        from_attributes = True
